package com.newblog.factory;

import java.sql.Connection;

import com.newblog.dao.PostDAO;
import com.newblog.dao.PostDAOMysql;

public class PostDaoFactory {
	private static PostDaoFactory factory = null;
	private PostDAO postDao;
	private Connection conn;
	private PostDaoFactory(){
		this.conn = DB.getConn();
		this.postDao = new PostDAOMysql(conn);
	}
	public static synchronized PostDaoFactory  getInstance(){
		if(factory==null)
			  factory  = new PostDaoFactory();
		return factory;
	}
	public PostDAO createPostDAO(){
		return this.postDao;
		
	}
	
}
